package com.hdoit.ares.web.ser.modelconfig;
import com.hdoit.ares.web.ser.providers.JobDutyTypeProvider;
import com.hdoit.ares.web.ser.providers.StaffBusinessProvider;
import com.hdoit.ares.web.ser.providers.StaffRoleProvider;
import com.hdoit.ares.web.ser.providers.StaffStoreProvider;
import com.tennetcn.common.enums.regular.RegularExpressions;
import com.tennetcn.component.attribute.DateTimeAttribute;
import com.tennetcn.component.attribute.DisplayNameAttribute;
import com.tennetcn.component.attribute.DropDownListAttribute;
import com.tennetcn.component.attribute.RegularExpressionAttribute;
import com.tennetcn.component.attribute.RequiredAttribute;
import com.tennetcn.component.attribute.base.ModelMetadataAttributeConfiguration;
import com.tennetcn.web.cbase.providers.SexProvider;

/**
 * @author      lvsi
 * @email       
 * @createtime  2017年11月27日 15:23:17
 * @comment
 */
public class StaffConfig extends ModelMetadataAttributeConfiguration{
    public StaffConfig(){
        this.setProperty("employeeName")
            .hasAttribute(new DisplayNameAttribute("员工姓名"))
        .hasAttribute(new RequiredAttribute("员工姓名为必填项"));

        this.setProperty("employeeCode")
            .hasAttribute(new DisplayNameAttribute("员工编码"));

        this.setProperty("markCode")
            .hasAttribute(new DisplayNameAttribute("编码"));

        this.setProperty("employeeAccount")
            .hasAttribute(new DisplayNameAttribute("员工账号"))
        .hasAttribute(new RequiredAttribute("员工账号为必填项"));

        this.setProperty("sex")
            .hasAttribute(new DisplayNameAttribute("性别"))
        .hasAttribute(new DropDownListAttribute(new SexProvider()));

        this.setProperty("mobile")
            .hasAttribute(new DisplayNameAttribute("手机"));

        this.setProperty("email")
            .hasAttribute(new DisplayNameAttribute("邮箱"));

        this.setProperty("userMark")
            .hasAttribute(new DisplayNameAttribute("备注"));

        this.setProperty("birthday")
            .hasAttribute(new DisplayNameAttribute("生日"))
            .hasAttribute(new DateTimeAttribute());

        this.setProperty("joinUsDate")
            .hasAttribute(new DisplayNameAttribute("入职时间"))
            .hasAttribute(new DateTimeAttribute());

        this.setProperty("jobDuty")
            .hasAttribute(new DisplayNameAttribute("职位"))
        .hasAttribute(new DropDownListAttribute(new JobDutyTypeProvider()));

        this.setProperty("liveAddress")
            .hasAttribute(new DisplayNameAttribute("家庭住址"));

        this.setProperty("idCard")
            .hasAttribute(new DisplayNameAttribute("身份证"))
        .hasAttribute(new RegularExpressionAttribute(RegularExpressions.idCard));;

        this.setProperty("storeId")
            .hasAttribute(new DisplayNameAttribute("店铺名称"))
        .hasAttribute(new DropDownListAttribute(new StaffStoreProvider(), false));
        
        this.setProperty("businessId")
		.hasAttribute(new DisplayNameAttribute("合作公司"))
		.hasAttribute(new DropDownListAttribute(new StaffBusinessProvider(), false));
	
	    this.setProperty("roleIds")
		.hasAttribute(new DisplayNameAttribute("员工角色"))
	    .hasAttribute(new RequiredAttribute("员工角色为必填项"))
	    .hasAttribute(new DropDownListAttribute(new StaffRoleProvider(), false));
    }

}
